﻿using com.guojin.core.io;
using com.guojin.core.io.message;

/* ***********************************************
 * Describe:消息体:客户端消息请求   加入俱乐部
 * Author :  MuLongFei
 * Email: 424113771@qq.com
 * DATA: 2017/7/14 11:47:04 
 * FileName: JoinClubReq 
 * Version: V1.0.1
 * ***********************************************/

namespace com.guojin.mj.net.message.club
{
    internal class JoinClubReq : Message
    {
        public static int TYPE = 7;
        public static int ID = 33;

        public int ClubId { get; set; }

        public int JoinType { get; set; }

        public void decode(Input _in)
        {
            JoinType = _in.readInt();
            ClubId = _in.readInt();
        }

        public void encode(Output _out)
        {
            _out.writeInt(JoinType);
            _out.writeInt(ClubId);
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public int getMessageId()
        {
            return ID;
        }

        public string toString()
        {
            return string.Format("joinType= {1},  JoinClubReq [clubId={0}]", ClubId, JoinType);
        }

        public static JoinClubReq create(int jointype, int clubid)
        {
            var joinclub = new JoinClubReq();
            joinclub.JoinType = jointype;
            joinclub.ClubId = clubid;
            return joinclub;
        }
    }
}